package servlet.admin.characters;

import entity.Operator;
import service.CharacterService;
import service.OperatorService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet( name = "AdminCharactersDeleteServlet")
public class AdminCharactersDeleteServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Integer characterID=Integer.parseInt(request.getParameter("characterID"));
        CharacterService service=new CharacterService();
        service.delete(characterID);
        request.getServletContext().getRequestDispatcher("/adminCharacter").forward(request, response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }
}
